package com.qiang.controller;

import com.qiang.enums.ExceptionCode;
import com.qiang.util.ResultEntity;

@SuppressWarnings("rawtypes")
public abstract class BaseController {
/*	@Autowired
	private CheckCodeService checkCodeService;*/

	protected static final String  AUTHORIZATION = "X-API-Token";

	//异常返回数据
	protected ResultEntity<?> buildResponseEntity(ExceptionCode exp){
		ResultEntity<?> responseEntity = new ResultEntity(exp);
		return responseEntity;
	}
	//异常返回数据
	protected ResultEntity buildResponseEntity(Integer code, String desc){
		ResultEntity responseEntity = new ResultEntity(code,desc);
		return responseEntity;
	}
	
	//成功返回数据
	@SuppressWarnings("unchecked")
	protected ResultEntity buildResponseEntity(Object modelData){
		ResultEntity responseEntity = new ResultEntity(modelData);
		return responseEntity;
	}
}
